SG Window Window Object
EnableMessageRange Method

©1998 by Stinga

Properties     Methods      Events     Constants     Error Codes
Description

Enables or disables firing of the Message events and calling of callback interfaces for specified messages.

Syntax

object.EnableMessageRange(startMsg As WinMsg, endMsg As WinMsg, Optional enable As Boolean = True)

Part Description
object The object is expression that evaluates to Window object
startMsg Required. Message code of the first message that will be enabled or disabled. WinMsg enumerator lists constants that can be used as a value for this parameter.
endMsg Required. Message code of the last message that will be enabled or disabled. WinMsg enumerator lists constants that can be used as a value for this parameter.
enable Optional. If True message is enabled; otherwise message is disabled. Default value is True.
Remarks

To receive any message, you must enable it using EnableMessage or EnableMessageRange methods.

Example

Following example shows how to enable mouse messages:

Public WithEvents wnd As SGWindow.Window

Sub Form_OnLoad()
   Set wnd = new SGWindow.Window
   wnd.hWnd = Me.hWnd
   wnd.EnableMessageRange wm_MOUSEFIRST, wm_MOUSELAST
   wnd.Hooked = True
End Sub